package site.zhouinfo.designpatterns.builder;

import java.util.ArrayList;
import java.util.List;
import site.zhouinfo.designpatterns.factory.common.MailSender;
import site.zhouinfo.designpatterns.factory.common.Sender;
import site.zhouinfo.designpatterns.factory.common.SmsSender;
/**
 * 建造者模式 建造类
 *
 * @author zhou
 * @create 2017-06-21 20:09
 * @email zhouinfo@qq.com
 * @blog blog.zhouinfo.site
 */
public class Builder {

    private List<Sender> list = new ArrayList<Sender>();

    public void produceMailSender(int count){
        for(int i=0; i<count; i++){
            list.add(new MailSender());
        }
    }

    public void produceSmsSender(int count){
        for(int i=0; i<count; i++){
            list.add(new SmsSender());
        }
    }

    // 获取建造出来的sender
    public List<Sender> getList() {
        return list;
    }

}
